home *** CD-ROM | disk | FTP | other *** search
- package com.commerceone.util.queue;
-
- public class ShiftRegister extends Queue {
- public ShiftRegister(int size) {
- super(size);
- }
-
- // $FF: renamed from: dq () java.lang.Object
- public synchronized Object method_0() throws QueueEmptyException {
- Object tmp = null;
- if (((Queue)this).isEmpty()) {
- throw new QueueEmptyException("Queue is empty");
- } else {
- tmp = super.vec.elementAt(super.frontIndex);
- super.vec.setElementAt((Object)null, super.frontIndex);
- super.frontIndex = (super.frontIndex + 1) % super.queueLen;
- return tmp;
- }
- }
-
- // $FF: renamed from: q (java.lang.Object) void
- public synchronized void method_1(Object entry) {
- if (((Queue)this).size() == super.queueLen - 1 && super.frontIndex != super.nextAvail) {
- super.vec.setElementAt((Object)null, super.frontIndex);
- super.frontIndex = (super.frontIndex + 1) % super.queueLen;
- }
-
- super.vec.setElementAt(entry, super.nextAvail);
- super.nextAvail = (super.nextAvail + 1) % super.queueLen;
- }
- }
-